#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  question2.py
#       Author @  Huoty
#  Create date @  2015-05-29 15:43:17
#  Description @  
# *************************************************************

# Question: 编写一个交错合并列表元素的函数
list1 = ['a', 'B', 'C']
list2 = [1, 2, 3]

def across_merge(list1, list2):
    '''交叉合并两个序列'''
    # 这里假定两个序列长度相等
    mlist = []
    cnt = len(list1)
    for index in range(cnt):
        mlist.append(list1[index])
        mlist.append(list2[index])

    return mlist

# Script starts from here

if __name__ == "__main__":
    print "原列表1：", list1
    print "原列表2：", list2
    print "交叉合并后结果：", across_merge(list1, list2)
